package com.ticket.sass.admin.dto.input.pricescheme;

import com.ticket.sass.admin.dto.output.film.FilmScheduleListOutput;
import com.ticket.sass.common.entity.tenant.FilmScheduleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author ywb
 * @date 2024-04-23 14:40
 */
@Data
@ApiModel("票价方案输入")
public class PriceSchemeInput {
    @ApiModelProperty(value = "对象ID")
    private Long objectId;
    
    @ApiModelProperty(value = "影厅ID")
    private Long hallId;
    
    @ApiModelProperty(value = "影片ID")
    private Long filmId;
    
    @ApiModelProperty(value = "放映时间")
    private LocalDateTime showTime;
    
    @ApiModelProperty(value = "发行价")
    private BigDecimal issuePrice;
    
    public PriceSchemeInput() {
    }
    
    public PriceSchemeInput(FilmScheduleListOutput output) {
        this.objectId = output.getId();
        this.hallId = output.getHallId();
        this.filmId = output.getFilmId();
        this.showTime = output.getStartTime();
        this.issuePrice = output.getLowestPrice();
    }
    
    public PriceSchemeInput(FilmScheduleEntity output) {
        this.objectId = output.getId();
        this.hallId = output.getHallId();
        this.filmId = output.getFilmId();
        this.showTime = output.getStartTime();
        this.issuePrice = output.getLowestPrice();
    }
}
